#pragma once
#include "sstream.h"
#include "tostring.h"
using namespace std;

class sstring : public string
{
public:
	template<typename T>
	inline sstring& operator=(T t)
	{
		sstream s;
	   	s << t;
		*this = s.str();
		return *this;
	}
public:
	template<typename T>
	inline const sstring& operator>>(T& t)const
	{
		sstream s;
		s << *this;
		s >> t;
		return *this;
	}
public:
	template<typename T>
	inline sstring& operator<<(T t)
	{
		sstream s;
		s << t;
		(*(string*)this) += s.str();
		return *this;
	}
	int toint(void)const
	{
		int v = 0;
		sstream s;
		s << data();
		s >> v;
		return v;
	}
};

